// Author: wsfuyibing <682805@qq.com>
// Date: 2025-04-25

package kind

// OperationKind
// 订单操作类别.
type OperationKind int

const (
    _ OperationKind = iota

    OperationKindCreated       // 创建订单
    OperationKindClosed        // 创建订单
    OperationKindDeleted       // 创建订单
    OperationKindPay           // 线上支付
    OperationKindPaySuccess    // 支付成功
    OperationKindPayFailed     // 支付失败
    OperationKindRefund        // 发起退单
    OperationKindRefundSucceed // 退单成功
    OperationKindRefundFailed  // 退单失败
)

var (
    orderOperationText = map[OperationKind]string{
        OperationKindCreated:       "创建订单",
        OperationKindClosed:        "关闭订单",
        OperationKindDeleted:       "删除订单",
        OperationKindPay:           "发起支付",
        OperationKindPaySuccess:    "支付成功",
        OperationKindPayFailed:     "支付失败",
        OperationKindRefund:        "发起退单",
        OperationKindRefundSucceed: "退单成功",
        OperationKindRefundFailed:  "退单失败",
    }
    orderOperationUndefined = ""
)

func (o OperationKind) String() string {
    if text, ok := orderOperationText[o]; ok {
        return text
    }
    return orderOperationUndefined
}
